

package com.xiuluo.dubbotest.dao;

import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.xiuluo.dubbotest.model.po.CachePO;
import com.xiuluo.dubbotest.model.po.UserPO;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * @author idea
 * @date 2020/2/26
 * @version V1.0
 */
@Mapper
public interface CacheDao extends BaseMapper<UserPO> {

    @Insert("INSERT INTO `t_cache`(`key`, `value`) values (#{key},#{value})")
    Integer saveCache(@Param("key") String key, @Param("value") String value);

    @Select("select * from t_cache where `key` = #{key}")
    CachePO getCache(@Param("key") String key);

}
